#132 implemented first version. Wrote a generic method to be used for all methods (except init, it's already implemented).