fixed bug / added comments