pretty bad implementation but just for tests