did some beutiful recursive programming