now bugs worked out