added unit tests; fix collision's physics