Fixed parameter problem and started writing tests