fixed minor issues. Works somehow