code divided by different functions