Working version, but something strange still going on