adapted Position.java