Bug fixing and added limits and stuff

shachars your move :)