Added update status function, cleaned up JS