refactored code formatting and added throw exceptions for unimplemented features