changed solutions to try not using clj lib functions.