implemented most of the methods