magnet refactored, controlPanel with first buttons added