fixed empty sketch bug and added comments