Cleaned code a lot; removed email functionality