Fixed formatting and added comments for menu functionality