fixed various bugs, minor UI updated and added flip option