first version of aes running + some restructuring