commented code, added semi functionaliy