Not quite right but somewhat working...