Partial solution for #004

func004 is not done yet