Rewrote screess bin in TypeScript