Code format
Added comments to functions