Function given into different pieces