implement all major functionality