added color and magic version. code clean up