seems working. clean code up later.