Revised GUI and added comments.