Almost completed functionalizing
Fixed careless committing