updated back end (working now)