Why are you defining $a twice?