fixed everything
fixed everything, added test