Working but very slow, need better bounds