Added some features. Need to be rewritten