bug fixes, remove hardcoding