minor changes and added initial tests