Added more fetaures. Cleaned up code.