Implemented addDrawToHistory function