Created a solution for last one but its probably not ideal