Added functionality to make it look nice and work.