Updated comments and added option application code