Back-end

finished most funtionality with the back-end
fixed indenting