reformated and rearranged
Added framework for AI