put everything into a method