added comments, implemented metadata method