Added default values, cleaned up and added comments