cleaned up some code on dev branch
fixed parethisis bug