Added implementation for functions required by the assignment along with some tests