Implemented all functions in general.go

Implemented all functions in general.go along with appropriate tests