fixed up code a little, previous issue still exists