made minor changes in various spots to achieve full stability + functionality