fixed the bug! at least partly, time to do some testing calculations!