added c solution