changed semantics and added basic code