#2 Added Tests and some functionality