another fix initial filling + more functions (TODO: fix matrix filling)