updated. not fully functional