Less clever, but somewhat working