finished euler #5, keeping cpp/h for further use