implemented simple rectangular collision