fixed up negative variables and added variable co-efficients