Modification of https://code.google.com/p/visual-planner/