Basic version almost done, all working now