sort of working; before gui change